<!DOCTYPE html>
<html>
	<head>
		<meta charset="gb2312" />
		<title>表单信息</title>
		<style>
			ul li{
				list-style:none;
			}
		</style>
	</head>
	<body>
		<form action="#">
			<table>
				<tr>
					<td><label for="txtName">用户名：</label></td>
					<td><input id="txtName" class="inputtxt" type="text"></td>
				</tr>
				<tr>
					<td><label for="txtPass">密　<!--v1-->码：</label></td>
					<td><input id="txtPass" class="inputtxt" type="password"></td>
				</tr>
				<tr>
					<td>性　别：</td>
					<td><input type="radio" name="sex" value="男">男
					<input type="radio" name="sex" value="女">女</td>
				</tr>
				<tr>
					<td>爱　好：</td>
					<td><input type="checkbox" name="vehicle" value="kandianying">看电影
					<input type="checkbox" name="vehicle" value="dushu">读书</td>
				</tr>
				<tr>
					<td>个人介绍：</td>
					<td><textarea cols="30" rows="15"></textarea></td>
				</tr>
				<tr>
					<td>家庭住址：</td>
					<td></td>
				</tr>
				</table>
				<input type="button" value="普通按钮"><br/>
				<input type="submit" value="提交按钮" id="btn1" onclick="btnLogin_click();"><br/>
				<input type="reset" value="重置按钮"><br/>

		<fieldset>
			<legend>
			请选择文件</legend>
			<input type="file" multiple id="inp"/>
		<ul id="typs"></ul>
		</fieldset>
		</form>
		<script>
			window.pageload=function(){
				var oTxtName=document.getElementById("txtName");
				var oTxtPass=document.getElementById("txtPass");
				var oBtn=document.getElementById("btn1");
				if(localStorage.getItem("txtName")&&localStorage.getItem("txtPass")){
					oTxtName.value=localStorage.getItem("txtName");
					oTxtPass.value=localStorage.getItem("txtPass");
					}
					oBtn.onclick=function(){
						localStorage.setItem("txtName",oTxtName.value);
						localStorage.setItem("txtPass",oTxtPass.value);
					}
			}
			window.onload=function(){
			 	var oInp=document.getElementById("inp");
			 	var oTips=document.getElementById("typs");
			 	oInp.onchange=function(){
			 		var str="";
			 		if(typeof FileReader=="undefined"){
			 			alert("检测到您的浏览器不支持fileReader对象!");
			 		}
			 		for(var i=0;i<this.files.length;i++){
			 			var reader=new FileReader();
			 			reader.readAsDataURL(this.files[i]);
			 			reader.onload=function(){
			 				str+="<li><img src='"+this.result+"'/></li>";
			 				oTips.innerHTML=str;
			 			}
			 		}
			 	}
			 }
		</script>
	</body>
</html>
